﻿<style type="text/css">
</style>
<div class="mv-edit validate-area" style="margin-top:10px;">
    <div class="cont-top">
        <span>真实姓名</span>
        <input type="text" :value="bag.basis.info.idname" readonly="readonly">
    </div>
    <div class="cont-top">
        <span>微信号码</span>
        <input id="wechat" type="text" class="validate-elem" :value="bag.basis.info.wechat" validate="true" validate-message="请输入微信号码" placeholder="请输入微信号码">
    </div>
    <div class="cont-top">
        <span>收款图片</span>
        <input id="wechatimg" type="file" validate="true" class="validate-elem" validate-message="请选择收款图片">
    </div>
    <div class="cont-top" style="position: relative;" v-if="bag.basis.info.issetmoblie == false">
        <span>手机验证码</span>
        <input id="smscode" type="text" class="validate-elem" placeholder="请输入验证码" validate="true" validate-message="请输入验证码">
        <input type="text" class="lg-yzm" value="获取验证码" readonly="readonly" v-on:click="send_sms($event)">
    </div>
    <div class="cont-top" style="position: relative;" v-if="bag.basis.info.issetemail == false">
        <span>邮箱验证码</span>
        <input id="mailcode" type="text" class="validate-elem" placeholder="请输入验证码" validate="true" validate-message="请输入验证码">
        <input type="text" class="lg-yzm" value="获取验证码" readonly="readonly" v-on:click="send_mail($event)">
    </div>
    <div class="cont-top" v-if="bag.basis.info.issetoptcode == false">
        <span>谷歌验证</span>
        <input id="otpcode" type="password" class="validate-elem" validate="true" validate-message="请输入谷歌验证码" placeholder="请输入谷歌验证码">
    </div>
</div>
<div style="height:60px;"></div>
<script type="text/javascript">
    var pagedata = {
        request: {
            method: "VIEW_USER_SETTING_WECHAT"
        },
        screen: {
            header_ok_display: true,
            header_display: true,
            header_title_name: "微信",
            header_exit_name: "返回",
            header_ok_name: '保存',
            header_exit_click: function () {
                mview.view.load('/views/User/paymeet.html')
            },
            header_ok_click: function () {
                //调用验证表单程序
                mview.view.form.validate("validate-area", function (data) {
                    //压缩图片
                    mview.custom.preview_image(document.getElementById("wechatimg"), 1000, function (wechatimg_base64) {
                        mview.socket.send({
                            data: {
                                method: "USEREDIT_WECHAT",
                                otpcode: data.otpcode || "",
                                wechat: data.wechat,
                                wechatimg: wechatimg_base64,
                                smscode: data.smscode || "",
                                mailcode: data.mailcode || ""
                            },
                            success: function (data) {
                                if (data.Code == 0) {
                                    mview.control.tips("修改成功");
                                    setTimeout(function () {
                                        mview.view.load("views/user/paymeet.html");
                                    }, 1500);
                                }
                                else {
                                    mview.control.tips(data.Message);
                                }
                            }
                        });
                    });
                });
            },
            header_display: true,
            footer_choose: "user"
        },
        data: {

        },
        methods: {
            send_sms: function (event) {
                var elm = event.target;
                mview.custom.sms_only_send(elm);
            },
            send_mail: function (event) {
                var elm = event.target;
                mview.custom.mail_only_send(elm);
            }
        }
    }
    mview.view.chlid.init(pagedata);
</script>